package com.example.myapplication.adapters;

import android.annotation.SuppressLint;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.example.myapplication.R;
import com.example.myapplication.bean.BannerBean;
import com.example.myapplication.library.BaseBannerAdapter;
import com.example.myapplication.library.VerticalBannerView;

import java.util.List;

/**
 * Created by Lx on 2019/3/28.
 */

public class VerticalBannerAdapter extends BaseBannerAdapter<BannerBean> {

    public VerticalBannerAdapter(List<BannerBean> datas) {
        super(datas);
    }

    @SuppressLint("InflateParams")
    @Override
    public View getView(VerticalBannerView parent) {
        return LayoutInflater.from(parent.getContext()).inflate(R.layout.item_01, null);
    }

    @Override
    public void setItem(View view, BannerBean data) {
        TextView tv = view.findViewById(R.id.item_tv);
        tv.setText(data.getMsg());
    }
}
